echo off
SET SRCDIR=D:\projects\libnmath\cpp2
SET JDKHOME=C:\Programs\Java\jdk1.7.0_71
SET INCLUDES=/I%JDKHOME%\include /I%JDKHOME%\include\win32 /I%SRCDIR%
SET SOURCES=%SRCDIR%\common.cpp %SRCDIR%\nlablexer.cpp %SRCDIR%\nlabparser.cpp %SRCDIR%\nfunction.cpp %SRCDIR%\criteria.cpp %SRCDIR%\compositecriteria.cpp %SRCDIR%\SimpleCriteria.cpp %SRCDIR%\StackUtil.cpp %SRCDIR%\StringUtil.cpp %SRCDIR%\nmath_pool.cpp 

IF %1 == 32 ( 
	cl /EHsc /LD /D"_WINDOWS" %INCLUDES% /nologo %SOURCES% jni-base.cpp function-jni.cpp function.cpp /link /out:"prebuild\nmath32.dll"
) ELSE (
	cl /EHsc /LD /D"_WINDOWS" %INCLUDES% /nologo %SOURCES% jni-base.cpp function-jni.cpp function.cpp /link /out:"prebuild\nmath64.dll"
)

copy prebuild\nmath*.dll ..\lib\nmath*.dll